<template>
  <div class="container">

<div class="yh-layout-box-comments comments-container">
      <div class="order-comments-contents">
        <div class="order-comments-header">
          <div class="header-title fl">我的评价</div>
          <div class="header-title fr comments-tips">评价需知
            <img src="../../../assets/images/member/comment_ico03.png">
          </div>
        </div>
        <div class="order-comments-list">
          <div class="order-company-wrap">
            <div class="companyName">
              {{ factoryName }} <img src="../../../assets/images/member/comment_ico02.png">
            </div>
            <div class="order-table">

              <div class="order-table-con">
                <div class="order-table-li" v-for="(item, index) in list">
                  <div class="table-product-info fl">
                    <span class="pd-pic-view">
                      <img :src="URL.PIC + item.productPic">
                    </span>
                    <span class="pd-title">
                      {{ item.productName }}
                    </span>
                  </div>
                  <div class="table-product-state fl">
                    <!-- 2019-03-05 10:34:31 初评 -->
                    {{ item.isEvaluation == 0 ? '待评价' :  '已评价' }}
                  </div>
                  <!-- <div class="table-product-state fl">
                    待评价
                  </div> -->
                  <div class="table-product-operation fl">
                    <!-- <div class="view-comments-btn operate-button">查看评价</div>
                    <div class="add-comments-btn operate-button">追评</div>
                    <div class="delete-comments-btn operate-button">删除评价</div> -->
                    <router-link :to="{name:'Comments', query:{orderId:item.id, productId:item.productId, productPic:item.productPic, productName:item.productName, specifications:item.specifications, productSpecificationId:item.productSpecificationId}}" class="add-btn" v-if="item.isEvaluation == 0">评价</router-link>
                    <router-link :to="{name:'Comments'}" class="add-btn" v-if="item.isEvaluation == 1">查看评价</router-link>
                  </div>
                  <!-- <div class="table-product-operation fl">
                    <div class="goComments">评价</div>
                  </div> -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
 </div>
  </div>
</template>

<script>
import Headbar from '@/components/Layouts/Headbar'
import HeadMenu from '@/components/Layouts/HeadMenu'
import Footbars from '@/components/Layouts/Footbars'
import { getOrderEvaluationList, getEvaluationList } from '@/api/order'
export default {
  name: 'MemberOrderComments',
  components: {
    Headbar,
    HeadMenu,
    Footbars,
  },
  data() {
    return {
      factoryName: this.getUrlParams('factoryName'),
      list: [],
      orderNo: this.getUrlParams('orderNo')
    }
  },
  created() {
    this.getEvaluationList()
  },
  methods: {
    getEvaluationList() {
      const params = {
        orderNo: this.getUrlParams('orderNo')
      }
      getEvaluationList(params).then(res => {
        if(res.code == 200){
          this.list = res.data
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.comments-container{
  margin-top: 0;
}
.yh-layout-box-comments{
  float: right;
  width: 978px;
  background: #fff;
  border: 1px solid #eee;
  -webkit-box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.06);
  box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.06);
}
@import '@/styles/pages/comments.scss';
</style>
